<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>新增学生</title>
</head>
<body>
<h1>新增学生</h1>
<form action="/addStu" th:object="${stu}">
  姓名：<input type="text" th:field="*{name}"><br>
  <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></span><br>
  Java：<input type="number" th:field="*{java}"><br>
  <span th:if="${#fields.hasErrors('java')}" th:errors="*{java}"></span><br>
  <input type="submit">
</form>
</body>
</html>